A little introduction to my project

The idea for this project came from a conversation I had just a few months back. I was catching-up with an old roommate of mine who has since found himself exploring the world of real estate. He was explaining to me how his research has led him to focus his attention on student rental properties, just like the one we used to live in together. As a poor college student myself, the idea of generating some passive income is more than enticing. It was very soon in the conversation, however, that I realized his method of finding properties to rent was fairly inefficient. The thought then came to me: if my friend can have so much success with his current strategy to find properties, surely I could have the same success by developing an even better strategy! Thus, I set-out to find my next student rental property and here’s what I found…

Planning

First, I wanted to narrow down the search of properties to those which are located near university campuses that will consistently have the greatest amount of students looking for a place to live.
To do this, I searched the web for the universities with the greatest undergraduate population. I scraped (using rvest) this wikipedia page that had a neatly kept list of the Top 10 Most Populous Universities and their undergraduate populations from 2009 to present.

Here’s a look at the first 10 rows:

year_start year_finish campus city state pop
2020 2021 Texas A&M University College Station Texas 73284
2020 2021 University of Central Florida Orlando Florida 70406
2020 2021 Ohio State University Columbus Ohio 67772
2020 2021 University of Florida Gainesville Florida 60613
2020 2021 Florida International University Miami Florida 56627
2020 2021 University of Illinois at Urbana–Champaign Urbana/Champaign Illinois 56299
2020 2021 Arizona State University Tempe Arizona 54000
2020 2021 Georgia State University Atlanta Georgia 52530
2020 2021 University of Minnesota Minneapolis/Saint Paul Minnesota 52376
2020 2021 University of Texas at Austin Austin Texas 51992

And here’s a look at each campus on the Wikipedia page through the years:
Note that some campuses made the list only a few times, whereas others were on the list every year.

Finally, here is a list of the schools that were in the Top 10 Most Populous Universities for over ten years and the number of years they were on it. These schools consistently had the greatest amount of students looking for a place to live.

campus num
Arizona State University 12
Ohio State University 12
Texas A&M University 12
University of Central Florida 12
University of Florida 12
University of Minnesota 12
Florida International University 11
University of Texas at Austin 11

But, wait…

What if these universities house the majority of their students on campus? To account for this, I had to do a little more digging. I visited a variety of sources to determine what percent of students typically live on-campus vs off-campus at each of the previously mentioned universities, and then compiled a list. Here’s a look at those percentages:

campus on off
Texas A&M University 20 80
University of Central Florida 15 85
Ohio State University 24 76
University of Florida 16 84
Florida International University 5 95
University of Illinois at Urbana–Champaign 50 50
Arizona State University 19 81
Georgia State University 15 85
University of Minnesota 13 87
University of Texas at Austin 8 92
University of South Florida 10 90
Michigan State University 6 94
Indiana University 27 73
Pennsylvania State University 26 74
Indiana University Bloomington 27 73

I then used these percentages to estimate the amount of the undergraduate students that will be looking for off-campus housing at each of these universities:
Note: although Texas A&M has a higher student population overall, the University of Central Florida most likely has more students in search of off-campus housing (and, hopefully, my rental property!)

year_start year_finish campus city state pop off_camp pop_adjusted
2020 2021 University of Central Florida Orlando Florida 70406 0.85 59845.10
2020 2021 Texas A&M University College Station Texas 73284 0.80 58627.20
2020 2021 Florida International University Miami Florida 56627 0.95 53795.65
2020 2021 Ohio State University Columbus Ohio 67772 0.76 51506.72
2020 2021 University of Florida Gainesville Florida 60613 0.84 50914.92
2020 2021 University of Texas at Austin Austin Texas 51992 0.92 47832.64
2020 2021 University of Minnesota Minneapolis/Saint Paul Minnesota 52376 0.87 45567.12
2020 2021 Georgia State University Atlanta Georgia 52530 0.85 44650.50
2020 2021 Arizona State University Tempe Arizona 54000 0.81 43740.00
2020 2021 University of Illinois at Urbana–Champaign Urbana/Champaign Illinois 56299 0.50 28149.50
2019 2020 University of Central Florida Orlando Florida 71948 0.85 61155.80
2019 2020 Texas A&M University College Station Texas 71109 0.80 56887.20
2019 2020 Florida International University Miami Florida 58928 0.95 55981.60
2019 2020 University of Florida Gainesville Florida 57841 0.84 48586.44
2019 2020 University of Texas at Austin Austin Texas 51832 0.92 47685.44

Here is a look at the mean of the adjusted populations for each university since 2009. The schools which are consistently in the Top Ten Most Populous Universities in the country are highlighted in yellow.

campus mean_pop
University of Central Florida 53843.68
Florida International University 51281.26
Texas A&M University 47518.87
University of Texas at Austin 47349.22
Michigan State University 45913.49
University of South Florida 45893.40
Ohio State University 45174.15
University of Minnesota 44928.68
Georgia State University 44829.00
Arizona State University 44711.19
University of Florida 44640.12
Indiana University 35289.66
Pennsylvania State University 33059.87
Indiana University Bloomington 30913.31
University of Illinois at Urbana–Champaign 26637.67

If I am going to find a rental property, these seem like a pretty good place to start looking! These universities consistently have the greatest amount of students looking for a place to live off-campus.

Gathering the Data

Finding the ideal property was no easy task. Although the web seems to be filled with an enormous amount of real estate data, most of this data is either kept private or is untrustworthy. In order to get my hands on the data I needed, I had to write some code that could scrape one of the most popular real estate websites: realtor.com.
Note: I made sure to check www.realtor.com/robots.txt to ensure that I wasn’t scraping pages that are forbiden

Here’s a look at the for-loop I created to find the metrics I was looking for:

library(tidyverse)
library(rvest)

cities <- c("College-Station_TX", "Orlando_FL", "Miami_FL", "Columbus_OH", 
            "Gainesville_FL", "Austin_TX", "Minneapolis_MN", "Atlanta_GA",
            "Tempe_AZ", "Champaign_IL", "Tampa_FL", "East-Lansing_MI",
            "University-Park_IL", "Bloomington_IN")

df1 = data.frame()

for (city in cities) {
  city_page = paste0("https://www.realtor.com/realestateandhomes-search/", city, "/beds-1/sqft-500/pg-")
  
  for (page_result in 1:8) {
    
    link = paste0(city_page, page_result, "")
    Sys.sleep(time = 10)
    page = read_html(link)
    
    address = page %>% html_nodes(".srp-address-redesign") %>% html_text()
    price = page %>% html_nodes(".srp-page-price > .bowEcH") %>% html_text()
    beds = page %>% html_nodes(".srp_list:nth-child(1)") %>% html_text()
    baths = page %>% html_nodes(".srp_list:nth-child(2)") %>% html_text()
    sq_ft = page %>% html_nodes(".srp_list:nth-child(3)") %>% html_text()
    location = rep(city, length(address))
    
    df1 = rbind(df1, data.frame(address, price, beds, baths, sq_ft, location,
                                stringsAsFactors = FALSE))
    
    print(paste("Page:", page_result))
    
    Sys.sleep(time = 5)
  }
  
  Sys.sleep(time=20)
  
  
}

write_csv(df1, file = "data/realtor.csv")

The beautiful thing about this code is that, with permission from Realtor.com, I will always have access to the most updated real estate listings from these fourteen cities in one neat and concise data frame. What would normally take hours of shuffling through page after page of search results, and manually imputing data into an excel spreadsheet, now takes minutes. Those few lines of code allow me to access thousands of up-to-date real estate listings in an easy-to-read format that I can manipulate to find the results I am looking for.
Here’s what it looks like:

address price beds baths sq_ft city
1 E Main St Ste 409, Champaign, IL 61820 210000 2 1.5 1185 Champaign
1 W Lake St Apt 309, Minneapolis, MN 55408 135000 1 1.0 735 Minneapolis
100 3rd Ave S Unit 605, Minneapolis, MN 55401 565000 2 2.0 1546 Minneapolis
100 S Eola Dr Unit 1113, Orlando, FL 32801 635000 2 2.5 1885 Orlando
100 S Eola Dr Unit 1211, Orlando, FL 32801 575000 2 2.5 2100 Orlando
1000 Brickell Plz Ph 6007, Miami, FL 33131 2715000 3 3.5 1912 Miami
1000 Brickell Plz Unit 3502, Miami, FL 33131 2050000 3 3.5 1909 Miami
1000 Spring Loop Apt 1306, College Station, TX 77840 174500 2 2.5 1168 College_Station
1000 W Horatio St Apt 207, Tampa, FL 33606 239999 1 1.0 631 Tampa
10000 SW 52nd Ave Unit V137, Gainesville, FL 32608 169900 1 1.0 965 Gainesville

What does the current market look like in these cities?

Here is the median home value and average price per square foot for a one bedroom property:

city Number_of_listings Median_home_value Avg_sq_ft Avg_Price_per_sqft
Atlanta 37 282500 858.9459 328.89148
Austin 14 412450 745.7143 553.09387
Bloomington 6 134900 891.3333 151.34630
Champaign 4 80700 671.7500 120.13398
College_Station 2 104750 649.5000 161.27791
Columbus 9 259900 859.1111 302.52199
East_Lansing 3 105000 1124.0000 93.41637
Gainesville 10 129700 704.4000 184.12834
Miami 50 324900 775.6600 418.86909
Minneapolis 45 189900 779.2222 243.70455
Orlando 16 150950 777.0625 194.25722
Tampa 15 200000 895.2667 223.39713
Tempe 18 210000 703.4444 298.53104
Urbana 1 15000 770.0000 19.48052

Two bedroom property:

city Number_of_listings Median_home_value Avg_sq_ft Avg_Price_per_sqft
Atlanta 73 369000 1422.110 259.4737
Austin 28 396995 1187.821 334.2211
Bloomington 61 219900 1277.279 172.1629
Champaign 51 119900 1112.176 107.8066
College_Station 20 198450 1230.050 161.3349
Columbus 91 189900 1209.055 157.0648
East_Lansing 33 204900 1373.394 149.1924
Gainesville 63 153000 1061.492 144.1367
Miami 79 425000 1222.886 347.5385
Minneapolis 87 270000 1178.103 229.1819
Orlando 74 199900 1195.716 167.1801
Tampa 71 244900 1183.676 206.8978
Tempe 69 325000 1176.261 276.2993
Urbana 39 112000 1068.590 104.8110

Three bedroom property:

city Number_of_listings Median_home_value Avg_sq_ft Avg_Price_per_sqft
Atlanta 137 375000 1777.693 210.9475
Austin 137 485000 1751.175 276.9569
Bloomington 150 289900 1894.440 153.0268
Champaign 94 169900 1569.064 108.2811
College_Station 161 270515 1622.335 166.7442
Columbus 164 248950 1504.341 165.4877
East_Lansing 92 248950 1890.185 131.7067
Gainesville 150 259600 1613.153 160.9270
Miami 107 499000 1590.972 313.6447
Minneapolis 91 269900 1650.440 163.5322
Orlando 137 315000 1533.219 205.4501
Tampa 140 350218 1642.757 213.1892
Tempe 132 459950 1582.485 290.6505
Urbana 57 178500 1558.947 114.5003

Four+ bedroom property:

city Number_of_listings Median_home_value Avg_sq_ft Avg_Price_per_sqft Avg_beds
Atlanta 83 535000 3036.253 176.20402 4.722892
Austin 152 547000 2542.303 215.15928 4.151316
Bloomington 116 489000 3364.336 145.34814 4.620690
Champaign 77 324900 2789.026 116.49228 4.610390
College_Station 150 425000 2543.833 167.07069 4.133333
Columbus 64 317845 2094.438 151.75674 4.109375
East_Lansing 82 490678 4483.476 109.44143 4.256098
Gainesville 113 433000 2479.743 174.61484 4.238938
Miami 100 687500 2452.290 280.35020 4.520000
Minneapolis 113 399500 2543.319 157.07824 4.876106
Orlando 109 475000 2659.817 178.58375 4.348624
Tampa 110 475990 2608.800 182.45554 4.363636
Tempe 117 595000 2507.581 237.28045 4.478632
Urbana 41 218000 2410.220 90.44819 4.609756

Finding the Property

When I first set out on this project, I wanted to compare home prices with the average price of rent for one bedroom in each city. This way I could estimate how much I would cash-flow from each property every month. Unfortunately, it wasn’t long before I realized that the average price of rent for any size home would be an extremely difficult number to estimate, if at all truly possible. So, instead, I had to rely on the metrics that I already had.
I knew that the most profitable home would be the one with the most rooms to rent out and the smallest monthly payment. In other words, I wanted to find which properties would offered me the most rooms at the lowest price. So, I create a new column on my data frame where I divided the price of every home by the number of rooms it has. It is listed here as “return”: Note: I decided to filter out all the homes with less than 3 rooms and less than 2 bathrooms.

address price beds baths sq_ft city return
3110 W Vernal Pike, Bloomington, IN 47404 1 3 2 1110 Bloomington 0.33
5611 E State Road 45 Hwy, Bloomington, IN 47408 1 3 2 1584 Bloomington 0.33
2727 E University Dr Lot 41, Tempe, AZ 85281 34500 3 2 1248 Tempe 11500.00
16430 Park Lake Rd Lot 72, East Lansing, MI 48823 48995 3 2 1216 East_Lansing 16331.67
1006 Windmill Grove Cir, Orlando, FL 32828 50000 3 2 1568 Orlando 16666.67
611 W Bradley Ave, Champaign, IL 61820 109900 6 2 1711 Champaign 18316.67
917 W Beardsley Ave, Champaign, IL 61821 92000 5 2 1728 Champaign 18400.00
1601 E Slaughter Ln Trlr 488, Austin, TX 78747 58995 3 2 1216 Austin 19665.00
1203 W Bradley Ave, Champaign, IL 61821 79900 4 2 1272 Champaign 19975.00
307 W Columbia Ave, Champaign, IL 61820 139900 7 2 2500 Champaign 19985.71


You’re telling me there are properties listed for $1?? You bet I’m checking this out!



Hmmm… I don’t know how appealing this will be to potential tenants… better keep looking!
That 6 bed home in Champaign looks interesting… better take a look!



Ta Da!

Now that’s more like it! It looks like this home has been on the market for a few months, but the owners are now facing foreclosure and recently dropped the price to what it is. The home has 6 bedrooms, 2 bathrooms, as well as two kitchens, a two-car garage, a new roof, and some new renovations! Plus, it’s only a 9 minute drive to the University of Illinois at Urbana–Champaign! After 12 months of renting out each room at $400 a room, I would be bringing in an estimated $1,777 a month (assuming a 20% down payment and a 30-year-loan with a fixed interest rate of 3.16%), while acquiring equity in the property. I think this is the deal I am looking for!

One more thought

What about that list of eight schools that consistently made the Top 10 Most Populous Schools over the last 12 years? University of Illinois wasn’t on it. Maybe I should narrow the list of properties to only those near these schools.

address price beds baths sq_ft city return
2727 E University Dr Lot 41, Tempe, AZ 85281 34500 3 2 1248 Tempe 11500.00
1006 Windmill Grove Cir, Orlando, FL 32828 50000 3 2 1568 Orlando 16666.67
1601 E Slaughter Ln Trlr 488, Austin, TX 78747 58995 3 2 1216 Austin 19665.00
2424 Phipps Ave, Orlando, FL 32818 60000 3 2 1440 Orlando 20000.00
13021 Dessau Rd Lot 726, Austin, TX 78754 71995 3 2 1216 Austin 23998.33
2340 E University Dr Lot 90, Tempe, AZ 85281 75000 3 2 900 Tempe 25000.00
13021 Dessau Rd Lot 193, Austin, TX 78754 85995 3 2 1456 Austin 28665.00
13021 Dessau Rd Lot 229, Austin, TX 78754 85995 3 2 1456 Austin 28665.00
2154 Minnesota Ave, Columbus, OH 43211 89000 3 2 1195 Columbus 29666.67
6519 W Newberry Rd Apt 1015, Gainesville, FL 32605 89000 3 2 1289 Gainesville 29666.67

All of these properties look like they need some additional work, I’ll keep looking down the list for something a little more… up-to-code…
Found one!

## # A tibble: 1 × 7
##   address                              price  beds baths sq_ft city       return
##   <chr>                                <dbl> <dbl> <dbl> <dbl> <chr>       <dbl>
## 1 521 Southwest Pkwy Apt 101, Colleg… 135000     4     4  1236 College_S…  33750

Here’s the corresponding page on Realtor.com:

This condo is listed at /$135,000. It includes 4 beds (each with its own private bathroom), a pool, a volleyball court, and is within walking distance to Texas A&M! Sounds like an easy pitch to an Aggie! At $500 a room, this property would cash-flow $988 month while generating equity over-time. And with the Texas A & M undergraduate population growing the way it has been, there will always be students looking for a sweet place to live near campus.

Wrapping it up

This project was tough, but the results of it are incredibly useful. Even if I decide to wait before investing into real estate, as long as I have access to this code, I can come back years from now and, with the push of a button, have the most up-to-date real estate listings from these areas. I have come to appreciate how powerful the Rvest package can be! With a few tweaks, this whole system could become totally automated to the point where any city could be scraped from a number of websites (imagine doing this with the MLS!). Now, its time to make me some money…